﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.Json.Serialization;
using System.Threading.Tasks;

namespace LightCAD.Core
{
    public class Path2d : ICurve2d
    {
        public Curve2dType Type => Curve2dType.Path2d;

        public ICurve2d[] Curves { get; set; }

        [JsonIgnore]
        public bool IsClosed
        {
            get
            {
                //TODO;
                return false;
            }
        }
        [JsonIgnore]
        public object Source { get; set; }
        public string Name { get; set; }

        public void Copy(ICurve2d src)
        {
            var path = src as Path2d;
            this.Curves = path.Curves.Clone<ICurve2d>();
            this.Name = path.Name;
        }
        public ICurve2d Clone()
        {
            var newObj = new Path2d();
            newObj.Copy(this);
            return newObj;
        }
        object ICloneable.Clone()
        {
            return this.Clone();
        }
    }
}
